package com.example.ormsqlsplicingframe1.sql;

import com.example.ormsqlsplicingframe1.session.EntitySession;
import org.apache.ibatis.annotations.Update;

public class SqlUtil {

    private static EntitySession session;

    public static void setSession(EntitySession session) {
        SqlUtil.session = session;
    }

    public static int excute(Sql sql){

        if(sql instanceof InsertSql){
           return session.insert((InsertSql) sql);
        }else if(sql instanceof DeleteSql){
           return session.delete((DeleteSql) sql);
        }else if(sql instanceof UpdateSql){
           return session.update((UpdateSql) sql);
        }

        throw new RuntimeException("不支持");

    }

    public static InsertSql insert(Object value){
        return null;
    }

    public static UpdateSql update(Object value){

        return null;
    }

}
